<h3 class="section"><a href="#toc-lut_002c-lutrgb_002c-lutyuv">11.153 lut, lutrgb, lutyuv</a></h3>

<p>Compute a look-up table for binding each pixel component input value
to an output value, and apply it to the input video.
</p>
<p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
to an RGB input video.
</p>
<p>These filters accept the following parameters:
</p><dl compact="compact">
<dt><samp>c0</samp></dt>
<dd><p>set first pixel component expression
</p></dd>
<dt><samp>c1</samp></dt>
<dd><p>set second pixel component expression
</p></dd>
<dt><samp>c2</samp></dt>
<dd><p>set third pixel component expression
</p></dd>
<dt><samp>c3</samp></dt>
<dd><p>set fourth pixel component expression, corresponds to the alpha component
</p>
</dd>
<dt><samp>r</samp></dt>
<dd><p>set red component expression
</p></dd>
<dt><samp>g</samp></dt>
<dd><p>set green component expression
</p></dd>
<dt><samp>b</samp></dt>
<dd><p>set blue component expression
</p></dd>
<dt><samp>a</samp></dt>
<dd><p>alpha component expression
</p>
</dd>
<dt><samp>y</samp></dt>
<dd><p>set Y/luma component expression
</p></dd>
<dt><samp>u</samp></dt>
<dd><p>set U/Cb component expression
</p></dd>
<dt><samp>v</samp></dt>
<dd><p>set V/Cr component expression
</p></dd>
</dl>

<p>Each of them specifies the expression to use for computing the lookup table for
the corresponding pixel component values.
</p>
<p>The exact component associated to each of the <var>c*</var> options depends on the
format in input.
</p>
<p>The <var>lut</var> filter requires either YUV or RGB pixel formats in input,
<var>lutrgb</var> requires RGB pixel formats in input, and <var>lutyuv</var> requires YUV.
</p>
<p>The expressions can contain the following constants and functions:
</p>
<dl compact="compact">
<dt><samp>w</samp></dt>
<dt><samp>h</samp></dt>
<dd><p>The input width and height.
</p>
</dd>
<dt><samp>val</samp></dt>
<dd><p>The input value for the pixel component.
</p>
</dd>
<dt><samp>clipval</samp></dt>
<dd><p>The input value, clipped to the <var>minval</var>-<var>maxval</var> range.
</p>
</dd>
<dt><samp>maxval</samp></dt>
<dd><p>The maximum value for the pixel component.
</p>
</dd>
<dt><samp>minval</samp></dt>
<dd><p>The minimum value for the pixel component.
</p>
</dd>
<dt><samp>negval</samp></dt>
<dd><p>The negated value for the pixel component value, clipped to the
<var>minval</var>-<var>maxval</var> range; it corresponds to the expression
&quot;maxval-clipval+minval&quot;.
</p>
</dd>
<dt><samp>clip(val)</samp></dt>
<dd><p>The computed value in <var>val</var>, clipped to the
<var>minval</var>-<var>maxval</var> range.
</p>
</dd>
<dt><samp>gammaval(gamma)</samp></dt>
<dd><p>The computed gamma correction value of the pixel component value,
clipped to the <var>minval</var>-<var>maxval</var> range. It corresponds to the
expression
&quot;pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval&quot;
</p>
</dd>
</dl>

<p>All expressions default to &quot;clipval&quot;.
</p>
